home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / pil50kit.zip / IN.PIL < prev    next >
Text File  |  1992-04-09  |  15KB  |  452 lines

  1. /* In the example which follows two PIL files are shown. One describes pages
  2.    1 and 2, the other describes the display ad placed on page 2. The PIL file 
  3.    for pages 1 and 2 would have been generated by a page layout system, that 
  4.    for the display ad by an ad makeup system.
  5.  
  6.    Additional, content files are needed to fully describe the pages and the
  7.    ad. These files are not included in the example.
  8. */
  9.  
  10.  
  11. /* ---------------------------------------------- */
  12. /* FILE DESCRIBING PAGES 1 & 2: /Pages/1_2/P00001 */
  13. /* ---------------------------------------------- */
  14.  
  15. pil-layout-5.00 "N PAGE 1" {
  16.  
  17. /* The name table associates entity names with the types of the
  18.    entities and their location. The format for each name table entry 
  19.    is "name", "type", "domain", and "value". The name is the way
  20.    by which the entity is identified in a pil-layout; the "type" is
  21.    the data format of the entity, and the domain and value, taken
  22.    together are used to locate the entity where it is stored, e.g.,
  23.    on a file system or database. Thus, the renderable content for the
  24.    headline and photo are defined as "postscript" and "tiff" respectively.
  25.    The editable content for the FIRE story body text is "ascii-text".
  26.  
  27.    The renderable and editable content locations are specified as "lcd-
  28.    filenames". "lcd" stands for "least common denominator". It requires
  29.    that the files are in the same directory as the PIL itself and that
  30.    the names can be represented as DOS filenames. The domain and value of
  31.    "inline" means that the entity appears later in this file. */
  32.  
  33.     name-table {
  34.         "N FIRE HD 1"    postscript    lcd-filename    "R00001"
  35.         "N FIRE PH 1"    tiff            lcd-filename    "R00002"
  36.         "N FIRE BT"        ascii-text    lcd-filename    "E00001"
  37.         "N PAGE 2"        pil-layout    inline            inline
  38.     }
  39.  
  40. /* The canvas is the root of the hierarchy. The subordinates are the
  41.    following objects which appear in imaging order from lowest to
  42.    highest.
  43.  
  44.    "units" specifies how to interpret dimensions, both for
  45.    the current object and for those objects which do not re-specify
  46.    the units of measure. Thus, units of measure are inherited, down
  47.    the tree. In this case units of measure is chosen such that 1 unit
  48.    equals 1/1000th of an inch.
  49.  
  50.    "dimensions" provides the horizontal and vertical width of the
  51.    canvas. This is the physical imaging area for all content rendered
  52.    on the canvas. So, content is clipped to the canvas size. In this
  53.    case an 8.5 by 11 inch page is indicated.
  54.  
  55.    "user-name" is an arbitrary string which is not used for final
  56.    rendering. Its typical use is to provide a name for the canvas
  57.    which is meaningful to a user, and may be used to label an object
  58.    when it is drawn in dummy or outline mode.
  59.  
  60.    In addition to these items, a canvas type, clipper and application
  61.    specific attributes may be specified. These are not used in this
  62.    example. */
  63.  
  64.     canvas {
  65.         dimensions { 8500 11000 }
  66.         units 25400
  67.         user-name "Page 1"
  68.     }
  69.  
  70. /* Objects are used to specify the content which must be rendered
  71.    on the canvas. This object represents the headline of the FIRE
  72.    story.
  73.  
  74.    The origin coordinates specify the position for the object. 
  75.    The origin is specified relative to the coordinate system 
  76.    of the canvas.
  77.  
  78.    The dimensions, along with the origin coordinates, define the 
  79.    bounding rectangle of the area the object's content is rendered 
  80.    into. The content is scaled to fit into this area.
  81.  
  82.    An object can also be rotated, and a clip shape defined. In 
  83.    this example, the default rotation of 0 degrees is taken, 
  84.    and no clip shape is specified.
  85.  
  86.    Note that z-order is implied by the order of the objects; the
  87.    first object is bottommost and the last object is topmost.
  88.  
  89.    Several other attributes can be specified in the body of an object.
  90.    These are an identifier, units, type, rotation, clipper, container,
  91.    graphic, and application specific attributes. Subsequent examples
  92.    indicate the use of these.
  93.  
  94.    The bounding box is defined in the native content space. So,
  95.    for PostScript, electronic points are used. The content is
  96.    scaled to fit within the rectangle defined by the origin
  97.    coordinates and dimensions. The bounding box specifies the 
  98.    portion of the content that is to be drawn into this rectangle.
  99.  
  100.    Bounding-box is optional. If omitted, the renderer will have
  101.    to determine the information from the content itself. For
  102.    example, a tagged content architecture might specify the
  103.    bounding rectangle as one of its tags. One particular case
  104.    is when the content is itself a PIL layout. Here the
  105.    dimensions of the referenced PIL canvas provide the bounding
  106.    box. 
  107.  
  108.    rc-name gives the name for the entity containing the content
  109.    ("rc" stands for "renderable content"). The entity name table 
  110.    associates this name with the physical location. In this case 
  111.    the entity name is "N FIRE HD 1". The name table indicates that 
  112.    the content is contained by a PostScript file, "R00001", in 
  113.    the same directory as the PIL file.
  114.  
  115.    The rc-type indicates the kind of data to be rendered.
  116.    This is a union of "text", "structured-graphics", "lineart",
  117.    and "image". If available, this information can be used by a 
  118.    renderer to make processing decisions. */
  119.  
  120.     object {
  121.         origin { 750 500 }
  122.         dimensions { 7000 1500 }
  123.         user-name "Fire Story Headline"
  124.         bbox { 0 108 252 108 }
  125.         rc-name "N FIRE HD 1"
  126.         rc-type { text }
  127.     }
  128.  
  129. /* This next object describes the photograph for the FIRE story.
  130.    It illustrates the use of some additional PIL constructs. These
  131.    are a clipper and a graphic. */
  132.  
  133.     object {
  134.         origin { 2500 4450 }
  135.         dimensions { 3500 3500 }
  136.         user-name "Fire Story Photo"
  137.  
  138. /* A clipper is used to clip the content of the object.
  139.    Note that it is only the content which is clipped -- in
  140.    particular the object graphic is not clipped. The clipper
  141.    is a shape defined in the object coordinate system. In this
  142.    case a clipper is defined to crop the photograph. */
  143.  
  144.         clipper {
  145.             rectangle { 0 0 3500 3500 }
  146.         }
  147.  
  148. /* The object-graphic can be used to render simple graphics at the
  149.    object level. Examples are rules and boxes. In this case the
  150.    graphic is used to render a trap rule for the photograph. The
  151.    trap rule is a 1-point wide square. */
  152.  
  153.         graphic {
  154.             color-model pantone
  155.             render-op stroke
  156.             render-attributes {
  157.                 stroke-color "192"
  158.                 position outside
  159.                 width 14
  160.                 cap butt-cap
  161.                 join miter-join
  162.                 miter-limit 10
  163.             }
  164.             rectangle { 0 0 3500 3500 }
  165.         }
  166.         bbox { 0 0 350 350 }
  167.         rc-name "N FIRE PH 1"
  168.         rc-type { image }
  169.     }
  170.  
  171. /* The next two objects define the body text columns of the FIRE story.
  172.    These illustrate the use of container shapes and identifiers.
  173.  
  174.    A container shape is used to define a shape for composing content.
  175.    A single, closed shape may be specified. This restriction avoids the
  176.    problem of defining z-order for multiple, overlapping shapes.
  177.  
  178.    Linkage of containers into flow sequences is specified with the
  179.    "text-flow" construct. This construct specifies a series of objects
  180.    which are to be linked into a flow sequence. The objects are
  181.    identified by their id's. */
  182.  
  183.     object {
  184.         id "I FIRE BT 1"
  185.         origin { 750 2600 }
  186.         dimensions { 3400 8400 }
  187.         user-name "Fire Story Body Column 1"
  188.         container {
  189.             polygon {
  190.                 {    0    0 } { 3400    0 }
  191.                 { 3400 2300 } { 1700 2300 }
  192.                 { 1700 5900 } { 3400 5900 }
  193.                 { 3400 8400 } {    0 8400 }
  194.             }
  195.         }
  196.     }
  197.  
  198.     object {
  199.         id "I FIRE BT 2"
  200.         origin { 4350 2600 }
  201.         dimensions { 3400 8400 }
  202.         user-name "Fire Story Body Column 2"
  203.         container {
  204.             polygon {
  205.                 {    0    0 } { 3400    0 }
  206.                 { 3400 8400 } {    0 8400 }
  207.                 {    0 5900 } { 1700 5900 }
  208.                 { 1700 2300 } {    0 2300 }
  209.             }
  210.         }
  211.     }
  212.  
  213. /* This text flow defines the layout and content which forms the
  214.    body of the FIRE story. The layout sequence jumps from PAGE 1 to
  215.    PAGE 2. This is specified by the "to" entry. */
  216.  
  217.     text-flow {
  218.         flow-label "L FIRE BT"
  219.         objects { "I FIRE BT 1" "I FIRE